﻿namespace PrismEx.SampleApp.Model
{
    using System.Collections.Generic;
    using System.ComponentModel.Composition;
    using System.Data.Entity;

    [Export]
    public class CustomerRepository
    {
        private readonly DataContext dataContext;

        [ImportingConstructor]
        public CustomerRepository(DataContext dataContext)
         {
             this.dataContext = dataContext;
         }

         public IEnumerable<Customer> GetCustomers()
         {
             dataContext.Customers.Load();

             return dataContext.Customers.Local;
         }
    }
}